
function requiredFieldValidator(value) {
	if (value == null || value == undefined || !value.length) {
		return {valid:false, msg:"This is a required field"};
	} else {
		return {valid:true, msg:null};
	}
}

function selectMultipleRows() {
    if (!Slick.GlobalEditorLock.commitCurrentEdit()) { 
    	return; 
    }
    grid.setSelectedRows([0,1,2]);
}

$(function() {
	var grid;
	var columns = [{
	    id: "#",
	    name: "",
	    width: 40,
	    behavior: "selectAndMove",
	    unselectable: true,
	    resizable: false,
	    cssClass: "cell-reorder"
	}, {
	    id: "name",
	    name: "名称",
	    field: "name",
	    width: 100,
	    cssClass: "cell-title"
	}, {
	    id: "code",
	    name: "货币",
	    field: "code",
	    width: 80,
	    cssClass: "cell-title"
	}, {
	    id: "data",
	    name: "汇率",
	    field: "data",
	    width: 80,
	    cssClass: "cell-title"
	},{
	    id: "content",
	    name: "备注",
	    field: "content",
	    width: 300,
	    cssClass: "cell-title"
	}];

	var options = {
			editable: false,
			enableAddRow: false,
			rowHeight: 30,
			autoHeight: true
		};	
	
	grid = new Slick.Grid($("#exchange"), data, columns, options);	
});
